﻿<%@ Page Language="C#" MasterPageFile="~/View/Admin/Template.master" AutoEventWireup="true" CodeFile="QuanLySanPham.aspx.cs" Inherits="View_Admin_QuanLySanPham" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style2
        {
            height: 23px;
        }
        .style5
        {
        }
        .style6
        {
            height: 23px;
            width: 204px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table align="left" style="width: 460px">
        <tr>
            <td align="right" class="style5">
                Tên hoa :</td>
            <td align="left">
                <asp:TextBox ID="txtTenHoa" runat="server" Width="209px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="txtTenHoa" Display="Dynamic" ErrorMessage="Không được trống" 
                    ValidationGroup="a"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right" class="style5">
                Loại Hoa :</td>
            <td align="left">
                <asp:DropDownList ID="dropLoaiHoa" runat="server" Width="209px">
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ControlToValidate="dropLoaiHoa" Display="Dynamic" 
                    ErrorMessage="Không được trống" ValidationGroup="a"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right" class="style5">
                Số Lượng :</td>
            <td align="left">
                <asp:TextBox ID="txtSl" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ControlToValidate="txtSl" Display="Dynamic" ErrorMessage="Không được trống" 
                    ValidationGroup="a"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="txtSl" Display="Dynamic" ErrorMessage="Phải nhập số" 
                    ValidationExpression="[0-9]+" ValidationGroup="a"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td align="right" class="style5" valign="top">
                Nguồn gốc:</td>
            <td align="left" valign="top">
                <asp:TextBox ID="txtNguonGoc" runat="server" Height="93px" TextMode="MultiLine" 
                    Width="214px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                    ControlToValidate="txtNguonGoc" Display="Dynamic" 
                    ErrorMessage="Không được trống" ValidationGroup="a"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right" class="style5" valign="top">
                Ý Nghĩa :</td>
            <td align="left">
                <asp:TextBox ID="txtYNghia" runat="server" Height="88px" TextMode="MultiLine" 
                    Width="212px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                    ControlToValidate="txtYNghia" Display="Dynamic" ErrorMessage="Không được trống" 
                    ValidationGroup="a"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right" class="style6">
                Giá :</td>
            <td align="left" class="style2">
                <asp:TextBox ID="txtGia" runat="server" Width="208px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                    ControlToValidate="txtGia" Display="Dynamic" ErrorMessage="Không được trống" 
                    ValidationGroup="a"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                    ControlToValidate="txtGia" Display="Dynamic" ErrorMessage="Phải nhập số" 
                    ValidationExpression="[0-9]+" ValidationGroup="a"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td align="right" class="style6">
                Hình ảnh :</td>
            <td align="left" class="style2">
                <asp:FileUpload ID="FileUpload1" runat="server" />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                    ControlToValidate="FileUpload1" Display="Dynamic" 
                    ErrorMessage="Không được trống" ValidationGroup="a"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right" class="style5">
                <asp:Label ID="lblThongBao" runat="server" Font-Italic="True" ForeColor="Red"></asp:Label>
            </td>
            <td class="style5">
                <asp:Button ID="btnThem" runat="server" onclick="btnThem_Click" Text="Thêm" 
                    ValidationGroup="a" />
            </td>
        </tr>
        <tr>
            <td align="left" class="style5" colspan="2">
                Sản phẩm hiện có<br />
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="hinhanh,maloai,soluong,mahoa" onrowcancelingedit="GridView1_RowCancelingEdit" 
                    onrowediting="GridView1_RowEditing" onrowupdating="GridView1_RowUpdating" 
                    onrowdeleting="GridView1_RowDeleting" Height="529px" Width="540px">
                    <Columns>
                        <asp:BoundField DataField="tenhoa" HeaderText="Tên hoa" />
                        <asp:BoundField DataField="nguongoc" HeaderText="Nguồn gốc" />
                        <asp:BoundField DataField="ynghia" HeaderText="Ý Nghĩa" />
                        <asp:BoundField DataField="giahoa" HeaderText="Giá" />
                        <asp:TemplateField HeaderText="Loại Hoa">
                            <EditItemTemplate>
                                <br />
                                <table align="center" class="style1">
                                    <tr>
                                        <td>
                                            Thể Loại :</td>
                                        <td>
                                            <asp:DropDownList ID="DropDownList1" runat="server">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Số Lượng :</td>
                                        <td>
                                            <asp:TextBox ID="TextBox1" runat="server" Height="19px" Width="93px"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("tenloai") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Hình">
                            <EditItemTemplate>
                                <asp:FileUpload ID="FileUpload2" runat="server" Height="20px" Width="122px" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:ImageButton ID="ImageButton1" runat="server" Height="92px" 
                                    ImageUrl='<%# Eval("hinhanh") %>' Width="97px" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:CommandField CancelText="Hủy" EditText="Sửa" ShowEditButton="True" 
                            UpdateText="Cập nhật" />
                        <asp:CommandField DeleteText="Xóa" ShowDeleteButton="True" />
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
    </table>
</asp:Content>

